Combining Kanzi Studio projects into a Kanzi application
You can combine the content of several Kanzi Studio projects into a single Kanzi application. This enables you to:
- Distribute Kanzi application development across several teams. Each team can work on a different part of the same application at the same time.
- Include in your Kanzi applications content available only in kzb files.
- Use Kanzi Studio projects which only hold resources you want to use in multiple projects.
- Simplify the structure of your Kanzi application by splitting it into several Kanzi Studio projects.
For example, when you are developing an in-vehicle infotainment application consisting of several applications, you can develop each of these applications in one or more Kanzi Studio projects. You then use one Kanzi application to combine these Kanzi Studio projects into a single Kanzi application.
To combine Kanzi Studio projects into a single Kanzi application:
Learn how to combine content from Kanzi Studio projects by completing a tutorial. See Tutorial: Combine Kanzi Studio projects into a single Kanzi application.
Kanzi solution structure
A Kanzi solution is a Kanzi application which you use to combine Kanzi applications into a single Kanzi application.
When you create a Kanzi solution, use these guidelines:
When you add Kanzi Studio projects to a Kanzi solution, use these guidelines:
Using prefabs and resources from Kanzi Studio projects
To use prefabs and resources from Kanzi Studio projects:
- Open or create a Kanzi Studio project in which you want to use content from other Kanzi Studio projects.
- In the Library press Alt and right-click Project References, select Existing Project, select a Kanzi Studio project from which you want to use content in the target project, and click Open.
- In the Library > Project References select the project reference you created in the previous step.
TIPYou can open a referenced project in a new instance of Kanzi Studio by double-clicking the project name in the Project References library.
- In the Properties double-click the kzb file URL of the prefab or resource you want to use from that project, right-click, and select Copy.
You use the kzb URLs to access the content from another project.
- Use the content from the referenced project:
- To use a prefab, in the Project create either a Prefab Placeholder or a Prefab View node where you want to use the prefab, in the Properties set the Prefab Template or Prefab Template property to <ResourceID>, and paste the kzb file URL you copied in the previous step.
You can control prefabs from referenced projects. See Customizing and controlling prefabs from Kanzi Studio projects.
- To use a resource, in the Project select the node where you want to use the resource, in the Properties set the property where you want to use the resource to <ResourceID>, and paste the kzb file URL you copied in the previous step.
- (Optional) Customize and control the appearance of prefabs. See Customizing and controlling prefabs from Kanzi Studio projects.
Using prefabs and resources from kzb files
To use prefabs and resources from kzb files:
- Open or create a Kanzi Studio project in which you want to use content from a kzb file.
- In the Library press Alt and right-click Project References, select Existing .kzb, select a kzb file from which you want to use content in the target project, and click Open.
If the kzb file refers to other kzb files, you must also add the references to those kzb files.
- Use content from the kzb file:
- To use a prefab, in the Project create either a Prefab Placeholder or a Prefab View node where you want to use the prefab, in the Properties set the Prefab Template or Prefab Template property to <ResourceID>, and enter the kzb file URL of the prefab you want to use.
- To use a resource, in the Project select the node where you want to use the resource, in the Properties set the property where you want to use the resource to <ResourceID>, and enter the kzb file URL of the resource you want to use.
Customizing and controlling prefabs from Kanzi Studio projects
In a Kanzi solution when you use prefabs from a Kanzi Studio project, you can set the content and appearance of these prefabs. You can do this by using a property type in the root node of each a prefab which you bind to the prefab content that you want to control.
To control prefabs from Kanzi Studio projects:
- Open or create a project and add to that project a prefab from a Kanzi Studio project. See Using prefabs and resources from Kanzi Studio projects.
From here on this project is referred to as the target project.
- In the project which contains the prefab that you want to control, select the prefab and in the Properties next to the property with which you want to control the prefab click .
Kanzi Studio creates from that property a custom property, adds it to the root of the prefab, and creates a ##Template
binding to the property in the prefab root. This enables you to edit the appearance of the prefab from the root of the prefab.
For example, if you want to control the progress bar of a music player using a property called Progress, click next to that property.
From here on this project is referred to as the source project.
- In the target project, in the main menu select > > Merge Project and select the Kanzi Studio project where you modified the prefab in the previous step.
- In the Project Merge dialog select the property type with which you want to control the prefab and click Merge.
For example, select the Progress property.
- In the target project select the node you use to instantiate the prefab from the source project that you want to control and in the Properties add the property you merged.
You can now use the property in the target project to control the prefab from the source project.
Merging content from referenced Kanzi Studio projects
When you want to bring content from referenced Kanzi Studio projects you can merge the items you need.
To merge content from referenced Kanzi Studio projects, in the Library > Project References right-click the source project from which you want to bring content and select Merge Project.
Merge Project allows you to import only the selected items to the target project. When merging you can select which project items you want to import and resolve conflicts for items that exist in both projects. Kanzi Studio merges nodes from the source project to a new prefab. Kanzi Studio creates the nodes and resources even if they exist in the target project and you have not merged it before from the same project reference (in which case it is marked as identical). See Merging projects.
See also
Tutorial: Combine Kanzi Studio projects into a single Kanzi application
Importing projects
Merging projects
Open topic with navigation